package com.wxh.bomb.netty.myrpc.service;

import com.wxh.bomb.netty.myrpc.RpcConsumer;
import com.wxh.bomb.netty.myrpc.api.LoginService;
import com.wxh.bomb.netty.myrpc.bean.LoginInfo;

/**
 * @author wxh
 */
public class LoginAction {

    public LoginInfo getLoginInfo(String userCode, String passwd) {
        LoginService service = (LoginService) RpcConsumer.remote(LoginService.class);
        return service.login(userCode, passwd);
    }

    public static void main(String[] args) {
        for (int i=0; i< 10 ;i++) {
            final int num = i;
            new Thread(new Runnable() {
                public void run() {
                    LoginInfo login = new LoginAction().getLoginInfo("U201710010000" + num, "123456");
                    System.out.println(Thread.currentThread().getName() +" " + login);
                }
            }).start();
        }
    }
}
